package com.zhongkun.datahome.service.res.family;

import com.zhongkun.datahome.service.domain.CustomerBase;
import com.zhongkun.datahome.service.domain.CustomerFamily;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/17 09:43
 * @Desc
 */
@Data
public class CustomerFamilyVo extends CustomerFamily {
    @ApiModelProperty("客户姓名")
    private String customerName;

    @ApiModelProperty("客户手机")
    private String mobile;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("商户用户id")
    private Long tenantUserId;

    @ApiModelProperty("是否业主，0否，1是")
    private Integer isOwner;

    @ApiModelProperty("与业主关系")
    private String relation;

    public static CustomerFamilyVo of(CustomerFamily customerFamily, CustomerBase customerBase) {
        CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo();
        customerFamilyVo.setId(customerFamily.getId());
        customerFamilyVo.setFamilyName(customerFamily.getFamilyName());
        customerFamilyVo.setOwnerCustomerId(customerFamily.getOwnerCustomerId());

        customerFamilyVo.setCustomerName(customerBase.getCustomerName());
        customerFamilyVo.setMobile(customerBase.getMobile());
        customerFamilyVo.setUserId(customerBase.getUserId());
        customerFamilyVo.setTenantUserId(customerBase.getTenantUserId());
        customerFamilyVo.setIsOwner(customerBase.getIsOwner());
        customerFamilyVo.setRelation(customerBase.getRelation());
        return customerFamilyVo;
    }
}
